<?php
/**
 * PhpStorm
 * User: zucheng
 * Date: 2019/3/21
 */

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class MsgFee extends Model
{
    protected $table = 'v_msg_fee';

    /**
     * 不可批量赋值的属性
     * @var array
     */
    protected $guarded = ['id'];

    const PAYWAIT = 10; // 等待支付
    const PAYING = 20; // 支付确认中
    const PAYED = 30; // 已完成支付
    const REFUNDWAIT = 40; //等待退款
    const REFUNDING = 50; // 退款确认中
    const REFUNDED = 60; // 已退款

    // 支付方式
    const PAYMENT_ALI = 1; //支付宝
    const PAYMENT_WECHAT = 2; //微信

    // 支付状态说明
    public static $payStatusDesc = [
        self::PAYWAIT    => '等待支付',
        self::PAYING     => '待支付确认',
        self::PAYED      => '已支付',
        self::REFUNDWAIT => '待退款',
        self::REFUNDING  => '待退款确认',
        self::REFUNDED   => '已退款',
    ];

    // 订单信息
    public function order()
    {
        return $this->belongsTo('App\Models\Order', 'order_id', 'id');
    }

    // 司机信息
    public function driver()
    {
        return $this->belongsTo('App\Models\Member', 'driver_uuid', 'uuid');
    }

}